package swd.maintain.project.user_group_maintain;

import java.util.*;

public class View {
    public View() {
        setMultiLang();
        setDBProperties();
    }

    private String gstrOnloadScript;
    public String getOnloadScript() {
        return this.gstrOnloadScript;
    }

    // Insert form
    private String gstrInsertShow;
    public String getInsertShow() {
        return this.gstrInsertShow;
    }

    public void setInsertShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrInsertShow = pstrParameter;
    }


    public void setOnloadScript(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrOnloadScript = pstrParameter;
    }

    private String gstrPrgAction;
    public String getPrgAction() {
        return this.gstrPrgAction;
    }

    public void setPrgAction(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrPrgAction = pstrParameter;
    }

    private String gstrTipMessage;
    public String getTipMessage() {
        return this.gstrTipMessage;
    }

    public void setTipMessage(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrTipMessage = pstrParameter;
    }

    private String gstrPrgStatus;
    public String getPrgStatus() {
        return this.gstrPrgStatus;
    }

    public void setPrgStatus(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrPrgStatus = pstrParameter;
    }

    private String gstrFlowAction;
    public String getFlowAction() {
        return this.gstrFlowAction;
    }

    public void setFlowAction(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrFlowAction = pstrParameter;
    }

    private String gstrFlowStatus;
    public String getFlowStatus() {
        return this.gstrFlowStatus;
    }

    public void setFlowStatus(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrFlowStatus = pstrParameter;
    }

    private String gstrFlowNO;
    public String getFlowNO() {
        return this.gstrFlowNO;
    }

    public void setFlowNO(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrFlowNO = pstrParameter;
    }

    private String gstrPrgTitle;
    public String getPrgTitle() {
        return this.gstrPrgTitle;
    }

    public void setPrgTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrPrgTitle = pstrParameter;
    }

    private String gstrseqno;
    public String getseqno() {
        return this.gstrseqno;
    }

    public void setseqno(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrseqno = pstrParameter;
    }

    private String gstrBtnAddShow;
    public String getBtnAddShow() {
        return this.gstrBtnAddShow;
    }

    public void setBtnAddShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnAddShow = pstrParameter;
    }

    private String gstrBtnSaveShow;
    public String getBtnSaveShow() {
        return this.gstrBtnSaveShow;
    }

    public void setBtnSaveShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnSaveShow = pstrParameter;
    }

    private String gstrBtnQueryShow;
    public String getBtnQueryShow() {
        return this.gstrBtnQueryShow;
    }

    public void setBtnQueryShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnQueryShow = pstrParameter;
    }

    private String gstrBtnModifyShow;
    public String getBtnModifyShow() {
        return this.gstrBtnModifyShow;
    }

    public void setBtnModifyShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnModifyShow = pstrParameter;
    }

    private String gstrBtnCancelShow;
    public String getBtnCancelShow() {
        return this.gstrBtnCancelShow;
    }

    public void setBtnCancelShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnCancelShow = pstrParameter;
    }

    private String gstrBtnUpdateShow;
    public String getBtnUpdateShow() {
        return this.gstrBtnUpdateShow;
    }

    public void setBtnUpdateShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnUpdateShow = pstrParameter;
    }

    private String gstrBtnApproveShow;
    public String getBtnApproveShow() {
        return this.gstrBtnApproveShow;
    }

    public void setBtnApproveShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnApproveShow = pstrParameter;
    }

    private String gstrBtnRejectShow;
    public String getBtnRejectShow() {
        return this.gstrBtnRejectShow;
    }

    public void setBtnRejectShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnRejectShow = pstrParameter;
    }

    private String gstrBtnDraftShow;
    public String getBtnDraftShow() {
        return this.gstrBtnDraftShow;
    }

    public void setBtnDraftShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnDraftShow = pstrParameter;
    }

    private String gstrBtnExitShow;
    public String getBtnExitShow() {
        return this.gstrBtnExitShow;
    }

    public void setBtnExitShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnExitShow = pstrParameter;
    }

    private String gstrBtnAddTitle;
    public String getBtnAddTitle() {
        return this.gstrBtnAddTitle;
    }

    public void setBtnAddTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnAddTitle = pstrParameter;
    }

    private String gstrBtnSaveTitle;
    public String getBtnSaveTitle() {
        return this.gstrBtnSaveTitle;
    }

    public void setBtnSaveTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnSaveTitle = pstrParameter;
    }

    private String gstrBtnQueryTitle;
    public String getBtnQueryTitle() {
        return this.gstrBtnQueryTitle;
    }

    public void setBtnQueryTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnQueryTitle = pstrParameter;
    }

    private String gstrBtnModifyTitle;
    public String getBtnModifyTitle() {
        return this.gstrBtnModifyTitle;
    }

    public void setBtnModifyTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnModifyTitle = pstrParameter;
    }

    private String gstrBtnCancelTitle;
    public String getBtnCancelTitle() {
        return this.gstrBtnCancelTitle;
    }

    public void setBtnCancelTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnCancelTitle = pstrParameter;
    }

    private String gstrBtnUpdateTitle;
    public String getBtnUpdateTitle() {
        return this.gstrBtnUpdateTitle;
    }

    public void setBtnUpdateTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnUpdateTitle = pstrParameter;
    }

    private String gstrBtnApproveTitle;
    public String getBtnApproveTitle() {
        return this.gstrBtnApproveTitle;
    }

    public void setBtnApproveTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnApproveTitle = pstrParameter;
    }

    private String gstrBtnRejectTitle;
    public String getBtnRejectTitle() {
        return this.gstrBtnRejectTitle;
    }

    public void setBtnRejectTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnRejectTitle = pstrParameter;
    }

    private String gstrBtnDraftTitle;
    public String getBtnDraftTitle() {
        return this.gstrBtnDraftTitle;
    }

    public void setBtnDraftTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnDraftTitle = pstrParameter;
    }

    private String gstrBtnExitTitle;
    public String getBtnExitTitle() {
        return this.gstrBtnExitTitle;
    }

    public void setBtnExitTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnExitTitle = pstrParameter;
    }

    private String gstrBtnUploadTitle;
    public String getBtnUploadTitle() {
        return this.gstrBtnUploadTitle;
    }

    public void setBtnUploadTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrBtnUploadTitle = pstrParameter;
    }

    private String gstrDBAlias;
    public String getDBAlias() {
        return this.gstrDBAlias;
    }

    public void setDBAlias(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrDBAlias = pstrParameter;
    }

    private boolean gblnDBDebug;
    public boolean getDBDebug() {
        return this.gblnDBDebug;
    }

    public void setDBDebug(boolean pblnParameter) {
        this.gblnDBDebug = pblnParameter;
    }

    private String gstrSourceCharset;
    public String getSourceCharset() {
        return this.gstrSourceCharset;
    }

    public void setSourceCharset(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrSourceCharset = pstrParameter;
    }

    private String gstrTargetCharset;
    public String getTargetCharset() {
        return this.gstrTargetCharset;
    }

    public void setTargetCharset(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrTargetCharset = pstrParameter;
    }

    private String gstrFrm1Name;
    public String getFrm1Name() {
        return this.gstrFrm1Name;
    }

    public void setFrm1Name(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrFrm1Name = pstrParameter;
    }

    private String gstrgroup_no;
    public String getgroup_no() {
        return this.gstrgroup_no;
    }

    public void setgroup_no(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrgroup_no = pstrParameter;
    }

    private String gstrgroup_noTitle;
    public String getgroup_noTitle() {
        return this.gstrgroup_noTitle;
    }

    public void setgroup_noTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrgroup_noTitle = pstrParameter;
    }

    private boolean gblngroup_no_readonly;
    public boolean getgroup_no_readonly() {
        return this.gblngroup_no_readonly;
    }

    public void setgroup_no_readonly(boolean pblnParameter) {
        try {
            this.gblngroup_no_readonly = pblnParameter;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private String gstruser_no;
    public String getuser_no() {
        return this.gstruser_no;
    }

    public void setuser_no(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstruser_no = pstrParameter;
    }

    private String gstruser_noTitle;
    public String getuser_noTitle() {
        return this.gstruser_noTitle;
    }

    public void setuser_noTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstruser_noTitle = pstrParameter;
    }

    private boolean gblnuser_no_readonly;
    public boolean getuser_no_readonly() {
        return this.gblnuser_no_readonly;
    }

    public void setuser_no_readonly(boolean pblnParameter) {
        try {
            this.gblnuser_no_readonly = pblnParameter;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void setMultiLang() {
        ResourceBundle rbdTitleResource = ResourceBundle.getBundle(
                "swd\\maintain\\project\\user_group_maintain\\Multi-lang",
                Locale.getDefault());

        try {
            setgroup_noTitle(rbdTitleResource.getString("group_noTitle"));
            setuser_noTitle(rbdTitleResource.getString("user_noTitle"));
            setFrm1Name(rbdTitleResource.getString("Frm1Name"));
            setBtnAddTitle(rbdTitleResource.getString("BtnAddTitle"));
            setBtnSaveTitle(rbdTitleResource.getString("BtnSaveTitle"));
            setBtnQueryTitle(rbdTitleResource.getString("BtnQueryTitle"));
            setBtnModifyTitle(rbdTitleResource.getString("BtnModifyTitle"));
            setBtnCancelTitle(rbdTitleResource.getString("BtnCancelTitle"));
            setBtnUpdateTitle(rbdTitleResource.getString("BtnUpdateTitle"));
            setBtnApproveTitle(rbdTitleResource.getString("BtnApproveTitle"));
            setBtnRejectTitle(rbdTitleResource.getString("BtnRejectTitle"));
            setBtnDraftTitle(rbdTitleResource.getString("BtnDraftTitle"));
            setBtnExitTitle(rbdTitleResource.getString("BtnExitTitle"));
            setBtnUploadTitle(rbdTitleResource.getString("BtnUploadTitle"));
            setPrgTitle(rbdTitleResource.getString("prgTitle"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

// Rory Chen Add ---------------------------------------------------------------
    private String[] gstruser_no_g;
    public String[] getuser_no_g() {
        return this.gstruser_no_g;
    }

    public void setuser_no_g(String[] pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstruser_no_g = pstrParameter;
    }

    private String[] gstrgroup_no_g;
    public String[] getgroup_no_g() {
        return this.gstrgroup_no_g;
    }

    public void setgroup_no_g(String[] pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrgroup_no_g = pstrParameter;
    }


    private String gstrrowsn = null;
    public String getrowsn() {
        return this.gstrrowsn;
    }

    public void setrowsn(String pstrParameter) {
        this.gstrrowsn = pstrParameter;
    }

    private String gstrusername = null;
    public String getusername() {
        return this.gstrusername;
    }

    public void setusername(String pstrParameter) {
        this.gstrusername = pstrParameter;
    }

    private String gstrSelectShow;
    public String getSelectShow() {
        return this.gstrSelectShow;
    }

    public void setSelectShow(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrSelectShow = pstrParameter;
    }

    public void setReadOnly(boolean pstrParameter) {
        this.setgroup_no_readonly(pstrParameter);
        this.setuser_no_readonly(pstrParameter);
    }

    public void setAllClear() {
        this.setgroup_no("");
        this.setuser_no("");
        this.setusername("");
    }

    public void setButtonVisible(String strKind) {
        // strKind 種類
        // 此為預設按鍵，如要新增或修改，請自行修改

        // 初始化
        this.setBtnSaveShow("none");
         this.setInsertShow("none");

        // 新增
        if (strKind.equals("1")) {
            this.setBtnAddShow("none");
            this.setBtnSaveShow("");
             this.setInsertShow("");
        }

        // Save
        if (strKind.equals("2")) {
            this.setBtnAddShow("");
            this.setBtnSaveShow("none");
             this.setInsertShow("");
        }

        // 查詢
        if (strKind.equals("3")) {
            this.setBtnSaveShow("none");
            this.setInsertShow("none");

        }
    }


// -----------------------------------------------------------------------------


    private void setDBProperties() {
        ResourceBundle rbdTitleResource = ResourceBundle.getBundle("WEB_Config",
                Locale.getDefault());

        try {
            setDBAlias(rbdTitleResource.getString("DB_ALIAS"));
            setDBDebug(Boolean.valueOf(rbdTitleResource.getString("DEBUG")).
                       booleanValue());
            setSourceCharset(rbdTitleResource.getString("SOURCE_CHARSET"));
            setTargetCharset(rbdTitleResource.getString("TARGET_CHARSET"));
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            rbdTitleResource = null;
        }
    }

    public String getMessage(String pstrKey) {
        return ResourceBundle.getBundle(
                "swd\\maintain\\project\\user_group_maintain\\Multi-lang",
                Locale.getDefault()).getString(pstrKey);
    }
}
